package com.manage.project.biz.controller;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.manage.framework.aspectj.lang.annotation.Log;
import com.manage.framework.aspectj.lang.enums.BusinessType;
import com.manage.project.biz.domain.BizTujianjiegoujishupingding1;
import com.manage.project.biz.service.IBizTujianjiegoujishupingding1Service;
import com.manage.framework.web.controller.BaseController;
import com.manage.framework.web.domain.AjaxResult;
import com.manage.common.utils.poi.ExcelUtil;
import com.manage.framework.web.page.TableDataInfo;

/**
 Controller
 *
 * @author liutao
 *
 */
@RestController
@RequestMapping("/biz/tujianjiegoujishupingding1")
public class BizTujianjiegoujishupingding1Controller extends BaseController
{
    @Autowired
    private IBizTujianjiegoujishupingding1Service bizTujianjiegoujishupingding1Service;

    /**
     * 查询技术状况评定-分项列表
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegoujishupingding1:list')")
    @GetMapping("/list")
    public TableDataInfo list(BizTujianjiegoujishupingding1 bizTujianjiegoujishupingding1)
    {
        startPage();
        List<BizTujianjiegoujishupingding1> list = bizTujianjiegoujishupingding1Service.selectBizTujianjiegoujishupingding1List(bizTujianjiegoujishupingding1);
        return getDataTable(list);
    }

    /**
     * 导出技术状况评定-分项列表
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegoujishupingding1:export')")
    @Log(title = "技术状况评定-分项", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(BizTujianjiegoujishupingding1 bizTujianjiegoujishupingding1)
    {
        List<BizTujianjiegoujishupingding1> list = bizTujianjiegoujishupingding1Service.selectBizTujianjiegoujishupingding1List(bizTujianjiegoujishupingding1);
        ExcelUtil<BizTujianjiegoujishupingding1> util = new ExcelUtil<BizTujianjiegoujishupingding1>(BizTujianjiegoujishupingding1.class);
        return util.exportExcel(list, "技术状况评定-分项数据");
    }

    /**
     * 获取技术状况评定-分项详细信息
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegoujishupingding1:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(bizTujianjiegoujishupingding1Service.selectBizTujianjiegoujishupingding1ById(id));
    }

    /**
     * 新增技术状况评定-分项
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegoujishupingding1:add')")
    @Log(title = "技术状况评定-分项", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BizTujianjiegoujishupingding1 bizTujianjiegoujishupingding1)
    {

        return toAjax(bizTujianjiegoujishupingding1Service.insertBizTujianjiegoujishupingding1(bizTujianjiegoujishupingding1));
    }

    /**
     * 修改技术状况评定-分项
     */
    @Log(title = "技术状况评定-分项", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BizTujianjiegoujishupingding1 bizTujianjiegoujishupingding1)
    {
        return toAjax(bizTujianjiegoujishupingding1Service.updateBizTujianjiegoujishupingding1(bizTujianjiegoujishupingding1));
    }

    /**
     * 删除技术状况评定-分项
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegoujishupingding1:remove')")
    @Log(title = "技术状况评定-分项", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(bizTujianjiegoujishupingding1Service.deleteBizTujianjiegoujishupingding1ByIds(ids));
    }
}
